import React from 'react'
import ReactDOM from 'react-dom/client'
// import App from './App'
import './index.css'
// import Dashboard from '@/pages/dashboard'
import { Provider } from 'react-redux';

import { ConfigProvider } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import enUS from 'antd/locale/en_US';

import { locale } from '@/i18n';

import i18n from "i18next";
import { initReactI18next } from "react-i18next";

import 'normalize.css';
import {
  RouterProvider
} from 'react-router-dom'

import router from '@/router/router'

i18n.use(initReactI18next).init({
  resources: {
    zh: {
      translation: locale.cn
    },
    en: {
      translation: locale.en
    }
  },
  lng: localStorage.getItem('language') === 'en' ? 'en' : 'zh',
  fallbackLng: 'zh',
  interpolation: {
    escapeValue: false
  }
})

ReactDOM.createRoot(document.getElementById('root')!).render(
  // <React.StrictMode>
    <ConfigProvider locale={localStorage.getItem('language') === 'en' ? enUS : zhCN}>
      <RouterProvider router={router}></RouterProvider>
    </ConfigProvider>
  // </React.StrictMode>,
)
